<!DOCTYPE html>
<html lang="en">
	<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<title>startDrag</title>
	<script type="text/javascript" src="../../lufylegend-1.8.12.min.js"></script>
	</head>
	<body>
			<div id="legend"></div>
<script>
var tt;
var layer;
init(1000/50,"legend",800,450,main);
function main(){
	LGlobal.stageScale = LStageScaleMode.EXACT_FIT;
	LSystem.screen(LStage.FULL_SCREEN);

	LMultitouch.inputMode = LMultitouchInputMode.TOUCH_POINT;
	tt = new LTextField();
	tt.size = 18;
	tt.x = 10;
	tt.y = 50;
	tt.text = "使用手机或者平板电脑，多个手指同时拖动下面的方块进行测试";
	addChild(tt);
	
	layer = new LSprite();
	layer.y = 100;
	layer.graphics.drawRect(2,"#cccccc",[0,0,LGlobal.width,LGlobal.height],true,"#cccccc");
	addChild(layer);
	var child;
	for(var i=0;i<3;i++){
		child = new LSprite();
		child.x = 250*i;
		child.graphics.drawRect(2,"#ff0000",[0,0,100,100],true,"#ff0000");
		child.addEventListener(LMouseEvent.MOUSE_DOWN,ondown);
		child.addEventListener(LMouseEvent.MOUSE_UP,onup);
		layer.addChild(child);
	}
}
function ondown(e){
	e.clickTarget.startDrag(e.touchPointID);
}
function onup(e){
	e.clickTarget.stopDrag();
}
</script>
	</body>
</html>
